<template>
  <div class="index-container">
    <!-- 已生成 -->
    <div v-if="type === 0">
      <order-completed />
    </div>
    <!-- 未生成 -->
    <div v-else>
      <to-be-delivered />
    </div>
  </div>
</template>

<script lang="ts">
import OrderCompleted from './components/OrderCompleted/index.vue'
import ToBeDelivered from './components/ToBeDelivered/index.vue'
import { defineComponent, ref, provide } from 'vue'

export default defineComponent({
  components: {
    OrderCompleted,
    ToBeDelivered
  },
  setup() {
    const type = ref<number>(0)
    provide('platformOrderStatus', type)
    return {
      type
    }
  }
})
</script>

<style lang="scss" scoped>
.index-container {
  background: #fff;
}
</style>
